<?php
declare(strict_types=1);

namespace app\salesman\controller;

use app\model\SalesmanFinanceDaily as SalesmanFinanceDailyModel;


class SalesmanFinanceDaily extends Controller
{
    protected function initialize()
    {
        parent::initialize();
    }

    /**
     * 列表
     * @return \think\response\Json
     * @throws \think\db\exception\DbException
     */
    public function index() {
        $params = input('post.');
        $params['salesman_id'] = $this->salesman['id'];
        $model = new SalesmanFinanceDailyModel();
        $result = $model->dataList($params);
        return success('操作成功', $result);
    }

    /**
     * 业务员 所做业绩产品类型
     * @return \think\response\Json
     */
    public function getServType() {
        $salesmanId = $this->salesman['id'];
        $model = new SalesmanFinanceDailyModel();
        $result = $model->servTypeBySalesmanId($salesmanId);
        return success('操作成功', $result);
    }
}